POV-Ray : Newsgroups : povray.programming : Parsing an object : Parsing an object Server Time
28 Jul 2024 12:26:44 EDT (-0400)
  Parsing an object  
From: Warp
Date: 17 Jan 2001 09:17:21
Message: <3a65a971@news.povray.org>
Just noticed that my tesselation patch supports object identifiers but
not objects directly. That is, I can write:

tesselate { MyObject }

but I can't write, for example:

tesselate { object { MyObject scale 2 } }

  Although this alone seems irrelevant (because you could perfectly put the
transformations in the tesselate block instead of the object block), it's
more relevant when using the tesselation block inside meshes (because you
can tesselate the same object several times into the same mesh). For example
this way:

mesh
{ tesselate { object { MyObject translate y } }
  tesselate { object { MyObject rotate z*180 translate -y } }
}

  How should I parse that so that it would accept any form of an object and
not just object identifiers?

  I'm currently parsing it this way:

    EXPECT
      CASE (OBJECT_ID_TOKEN)
        Object = Token.Data;
      END_CASE

      ... (parsing of the other allowed keywords here) ...

      OTHERWISE
        UNGET
        EXIT
      END_CASE
    END_EXPECT


  How should I modify that?    

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.